package com.itheima.practise;

import java.util.Random;

public class Test01 {
    public static void main(String[] args) {
        int[] arr = new int[30];
        Random r = new Random();

        for (int i = 0; i < arr.length; i++) {
            int power = r.nextInt(100)+1;
            if (power > 5) {
                arr[i] = power;
            } else {
                arr[i] = 0;
            }
        }
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        System.out.println("今日小明偷走好友" + sum + "g能量");
    }
}
